package com.hardroid.workload.utils;

import java.util.ArrayList;

import com.hardroid.workload.R;
import com.hardroid.workload.ui.widget.EmployerItemView;
import com.hardroid.workload.workcalc.Employer;

import android.content.Context;
import android.database.DataSetObserver;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListAdapter;

public class EmployerAdapter extends BaseAdapter{

	Context context;
	ArrayList<Employer> lEmployer ;
	
	public EmployerAdapter(Context context ,ArrayList<Employer> lEmployer) {
		// TODO Auto-generated constructor stub
		this.lEmployer = lEmployer;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return lEmployer.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return lEmployer.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
					
		if (convertView == null){
			convertView = new EmployerItemView(context,(Employer) getItem(position), position);
			
		}else{
			((EmployerItemView)convertView).setEmployer((Employer)getItem(position), position);
		}
		return convertView;
	}
	
//	public int getSelection(){
//		this.
//		return 
//	}


}
